package com.bwie.es;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.DateFormat;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.util.Date;

@Data
@Document(indexName = "es_log",shards = 1,replicas = 0)
public class EsLog {

    @Id
    @Field(type = FieldType.Keyword)
    private Integer logId;

    /**
     *
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH-mm-ss",timezone = "GMT-8",shape = JsonFormat.Shape.STRING)
    @Field(type = FieldType.Date,format = DateFormat.custom,pattern = "yyyy-MM-dd HH-mm-ss")
    private Date createTime;

    /**
     *
     */
    @Field(type = FieldType.Integer)
    private Integer optId;

    /**
     *
     */
    @Field(type = FieldType.Text,analyzer = "ik_max_word")
    private String optName;

    /**
     *
     */
    @Field(type = FieldType.Text,analyzer = "ik_max_word")
    private String ip;

    /**
     *
     */
    @Field(type = FieldType.Text,analyzer = "ik_max_word")
    private String logName;

    /**
     *
     */
    @Field(type = FieldType.Integer)
    private Integer logType;

    /**
     *
     */
    @Field(type = FieldType.Text,analyzer = "ik_max_word")
    private String logContent;


    private static final long serialVersionUID = 1L;
}
